package handler.accountFormHandlers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.SQLException;

import javax.swing.JOptionPane;

import db.Account;
import db.DBConnectionFactory;
import db.DBConnector;

import form.AccountForm.AccountForm;

public class AccountCancelButtonActionListener implements ActionListener {

	AccountForm accountForm;
    DBConnector db;
    
    public AccountCancelButtonActionListener(AccountForm accountForm){
		this.accountForm = accountForm;
		db = new DBConnector();
	}
	
	public void actionPerformed(ActionEvent e) {
		accountForm.populate(Account.createAccount(accountForm.getUserName().getInput()));
		accountForm.getPassword().setInput("");
		accountForm.getAccountInfoForm().getRetypePassword().setInput("");
	}
}
